import { createRouter, createWebHashHistory } from 'vue-router'
import home from './modules/home'
import marketing from './modules/marketing'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: '/marketing/email/campaign'
    },
    ...home,
    ...marketing
  ],
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return { left: 0, top: 0 }
    }
  },
});

export default router